package home_8_17;

public abstract class  Car {
    private String type;
    private int date;
    private int price;

    public Car(String type,int price) {
        this.type = type;
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getDate() {
        return date;
    }

    public void setDate(int date) {
        this.date = date;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }
    public final int sprice() {
    int r = 0;
    r = getPrice()*getDate();
    return r;
    }
    protected abstract String xinXi();
    public int print(){
        String msg  = xinXi();
        int msg2 = sprice();
        System.out.println(msg);
        System.out.println("租金为"+msg2);
        return msg2;
    }
}
